// form.js
export default class FormPage {
    constructor() {
        this.userName = 'input[name=username]'
        this.password = 'input[name=password]'
        this.rangItem = 'input[name=range]'
        this.btnSelector = '#doSubmit'
        this.url = "http://127.0.0.1:5500/index.html";
    }
    submit(username, pwd,range) {
        cy.visit(this.url).then(res=>{
            cy.get(this.userName).focus().type(username);
            cy.get(this.password).focus().type(pwd);
            cy.get(this.rangItem).as("range").invoke("val",range).trigger("change");
            cy.clock()
            cy.tick(20000);
            let $submitbtn = cy.get("#doSubmit");
            $submitbtn.click();
        });
    }
}